var e = require;
var t = module;
var o = exports;
var ii, nn = this && this.__extends || (ii = function (t, e) {
    return (ii = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        ii(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }
),
    rr = this && this.__awaiter ||
        function (t, e, o, i) {
            return new (o || (o = Promise))(function (n, a) {
                function r(t) {
                    try {
                        l(i.next(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function s(t) {
                    try {
                        l(i.
                            throw(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(t) {
                    var e;
                    t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
                        t(e)
                    })).then(r, s)
                }
                l((i = i.apply(t, e || [])).next())
            })
        };
var oo = (this && this.__decorate) ||
    function (e, t, a, n) {
        var i,
            o = arguments.length,
            s = o < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, a)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);
        else
            for (var r = e.length - 1; r >= 0; r--)
                (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
        return o > 3 && s && Object.defineProperty(t, a, s), s;
    };
Object.defineProperty(o, "__esModule", { value: !0 });
var a = e("BaseModuleUI"),
    n = e("GlobalParams"),
    i = e("AssetsManager"),
    r = e("RoleSoldierInfo"),
    s = cc._decorator,
    l = s.ccclass,
    _ = s.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.dower_sprite = null),
                (t.star_node_view = null),
                (t.dower_tip_sprite = null),
                (t.dower_info_label = null),
                (t.dower_index = 0),
                (t.dower_int_num = 0),
                t
            );
        }
        return (
            nn(t, e),
            (t.prototype.showDowerInfo = function (e) {
                this.dower_index = e;
                var t = r.default.Dower_info[this.dower_index],
                    o = n.GlobalParams.PlayerDowerInfo.value.dower[this.dower_index];
                (this.dower_int_num = t.spirit_int[o]),
                    (this.dower_sprite.spriteFrame = i.default
                        .getInstance()
                        .getDowerImagerFrame("dower_" + this.dower_index)),
                    (this.dower_tip_sprite.spriteFrame = i.default
                        .getInstance()
                        .getDowerImagerFrame("dower_tip_" + this.dower_index)),
                    (this.dower_info_label.string = t.spirit_des + this.dower_int_num);
                for (
                    var a = o > this.star_node_view.childrenCount ? o : this.star_node_view.childrenCount, s = 1;
                    s < a;
                    s++
                ) {
                    var l = null;
                    this.star_node_view.children[s]
                        ? (l = this.star_node_view.children[s])
                        : (l = cc.instantiate(this.star_node_view.children[0])).setParent(this.star_node_view),
                        (l.active = s <= o);
                }
            }),
            (t.prototype.getDowerInfo = function () {
                return [this.dower_index, this.dower_int_num];
            }),
            oo([_(cc.Sprite)], t.prototype, "dower_sprite", void 0),
            oo([_(cc.Node)], t.prototype, "star_node_view", void 0),
            oo([_(cc.Sprite)], t.prototype, "dower_tip_sprite", void 0),
            oo([_(cc.Label)], t.prototype, "dower_info_label", void 0),
            oo([l], t)
        );
    })(a.default);
o.default = c;
